package com.zygh.lz.service;

import com.github.pagehelper.PageInfo;
import com.zygh.lz.entity.Gps;
import com.zygh.lz.entity.Patrolrecord;
import com.zygh.lz.entity.StationData;
import com.zygh.lz.entity.remould.Patrol;
import com.zygh.lz.entity.vo.CoordinateData;
import com.zygh.lz.vo.ResultBean;
import com.zygh.lz.vo.ResultBeans;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//巡查
public interface PatrolrecordService {
    //新增巡查记录
    ResultBeans addPatrolrecord(Patrolrecord patrolrecord);
    int addPatrolrecords(Patrolrecord patrolrecord);

    //修改巡查记录
    ResultBeans updatePatrolrecord(Patrolrecord patrolrecord);

    //删除巡查记录
    ResultBean delPatrolrecord(Integer id);

    //根据道路类型、部门查询所有巡查信息
    ResultBean selectByRoadtype(Integer staffid, String beginTime, String endTime, String staffnum, Integer sectionPid, Integer pageNo, Integer pageSize);


    //统计巡查
    ResultBean countPatrolrecord(String startTime, String endTime) throws Exception;

    //查询所有巡查记录
    ResultBean selectAllPatrolrecord();

    //查询所有巡查记录的视频
    ResultBean selectVideo();

    //根据开始时间，结束时间、道路名称查询巡查记录
    ResultBean selectDim(String roadName, String beginTime, String endTime);

    //查询个人
    ResultBean selectByStaff(Integer SysStaffId, String beginTime, String endTime);

    //手机端
    ResultBean selectByStaffapp(Integer SysStaffId, String beginTime, String endTime);

    //查询各个大队的巡查记录个数
    ResultBean selectRecordNum(String startDate, String endDate);

    //登录用户负责道路列表
    ResultBean selectByStaffId(Integer StaffId);

    ResultBean delectPatrolrecordById(int[] array);

    //根据id查询该人的巡查记录
    ResultBeans selectAllPatrolrecordById(Integer id, String time, Integer current, Integer size);

    ResultBeans selectAllGPSById(Integer staffId, Integer patrolrecordId);

    String selectTrackById(Integer staffId, Integer patrolrecordId);
    List<Map> selectTracksById(Integer patrolrecordId);


    ResultBean selectGPSById(Integer staffId, String startTime, String endTime);

    String vacuateGPS(String allGps);

    String vacuatesGPS(List<CoordinateData> coordinateData);

    List<HashMap> theDaySum(String battalion);


    Map<String, Object> typeSum(String battalion);

    List<Map<String,Object>> onLinePeople(Integer id);

    List<Map> countZD(String battalion) throws Exception;



    List<Map> yXtypeSum(String battalion);

    //按时间段统计日间各个岗位应到实到人
    List<Map> typeSumByTime(String battalion);

    //查询在线人最新的点位
    List<StationData> findNowByGps(double[] lon, double[] lat, Integer sectionid);

    //根据大队名称查询在人GPS
    List<HashMap> findNowStaffBySection(String time, String battalion, Integer type);

    HashMap findStaffSum(String time, String battalion, Integer type);

    //判断是否在圆内
    List<StationData> findCircleByGps(double circleX, double circleY, double r, Integer sectionid);

    //根据个人id查询改人当天是否签到
    ResultBean selectinfoByid(Integer id);

    //热力图统计
    List<HashMap> heatMap(String battalion);

    //应部署GPS
    List<HashMap> heatMapYD(String battalion);

    String exportPatrolRecord(HttpServletResponse response, Integer staffid, String beginTime, String endTime,
                              String staffnum) throws IOException;


    PageInfo<Map> findPatrolrecordInfo(Patrol patrol);


}
